package com.cloud.pole.shop.biz.shops;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.goods.ShopGoodsCategoryRecommMapper;
import com.cloud.pole.mapper.goods.ShopGoodsModelAttrMapper;
import com.cloud.pole.mapper.shops.ShopShopsQualificateMapper;
import com.cloud.pole.shop.model.entity.goods.ShopGoodsCategoryRecomm;
import com.cloud.pole.shop.model.entity.goods.ShopGoodsModelAttr;
import com.cloud.pole.shop.model.entity.shops.ShopShopsQualificate;
import com.cloud.pole.shop.model.entity.shops.ShopShopsWithBLOBs;

import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;

/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-08 16:23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ShopShopsQualificateBiz extends BaseBiz<ShopShopsQualificateMapper, ShopShopsQualificate> {
	
	@Cache(key="shopShopsQualificateList{1}-shopId-qualificate")
    public List<ShopShopsQualificate> selectListByShopId(Integer shopId, Integer qualificateStatus) {
		 Example example = new Example(ShopShopsQualificate.class);
		 Criteria criteria = example.createCriteria();
		 example.setOrderByClause("order_level");
		 criteria.andEqualTo("shopId", shopId);
		 if(qualificateStatus != null) {
			 criteria.andEqualTo("qualificateStatus", qualificateStatus);
		 }
		 return mapper.selectByExample(example);
    }
}
